#ifndef CM_STACK_H
#define CM_STACK_H

#ifdef __cplusplus
extern "C" {
#endif

struct cm_stack;

/*
 * @brief	create a stack
 * @param	size: each element's size in this stack
 * @param	capacity: max capacity(count of elements)
 * @return	NULL for failed
 */
struct cm_stack * cm_stack_create(int size, int capacity);

void cm_stack_delete(struct cm_stack **s);

int cm_stack_pop(struct cm_stack *s, char *data);

int cm_stack_push(struct cm_stack *s, char *data);

int cm_stack_empty(struct cm_stack *s);

#ifdef __cplusplus
}
#endif

#endif

